#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;

#define N 101

int tree[N];

int find_root(int x);

class graph_edge {
public:
    int a, b;
    double cost;

    bool operator<(const graph_edge &e) const {
        return cost < e.cost;
    }
} edge[6000];

class point{
public:
    double x, y;
    double get_distance(point p){
        double temp_distance = (x - p.x)*(x - p.x) + (y - p.y) * (y - p.y);
        return sqrt(temp_distance);
    }
} list[101];

int main(int argc, char const *argv[]) {
    int n;
    while (scanf("%d", &n) != EOF) {
        for (int i = 1; i <= n; ++i)
            scanf("%lf%lf", &list[i].x, &list[i].y);
        int size = 0;
        for (int i = 1 ; i <= n; i++){
            for (int j = i + 1; j <= n; j++){
                edge[size].a = i;
                edge[size].b = j;
                edge[size].cost = list[i].get_distance(list[j]);
                size++;
            }
        }
        sort(edge, edge + size);
        for (int i = 1; i <= n; ++i)
            tree[i] = -1;
        double result = 0;

        for (int i = 0; i < size; ++i) {
            int a_inedx = find_root(edge[i].a);
            int b_index = find_root(edge[i].b);
            if (a_inedx != b_index) {
                tree[a_inedx] = b_index;
                result += edge[i].cost;
            }
        }
        printf("%.2lf\n", result);
    }
    return 0;
}

int find_root(int x) {
    if (tree[x] == -1)
        return x;
    else {
        int temp_index = find_root(tree[x]);
        tree[x] = temp_index;
        return temp_index;
    }
}